package cn.virens.web.components.open.oauth.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

import cn.virens.web.components.open.oauth.Oauth2Service;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.request.AuthRequest;

public abstract class AbstractAuthConfig implements InitializingBean {

	protected @Autowired Oauth2Service mOauth2Service;
	protected @Autowired AuthStateCache mAuthStateCache;

	@Override
	public void afterPropertiesSet() throws Exception {
		this.mOauth2Service.addAuthRequest(getType(), getRequest());
	}

	protected abstract String getType();

	protected abstract AuthRequest getRequest();
}
